import { AfterViewInit, Component, ContentChild, ContentChildren, ElementRef, OnInit, QueryList } from '@angular/core';
import { ContentPanelComponent } from './panel/panel.component';

@Component({
  selector: 'app-content-child',
  templateUrl: './content-child.component.html',
  styles: [
  ]
})
export class ContentChildComponent implements OnInit, AfterViewInit {
  // @ContentChild('list', { static: true }) private listEl: ElementRef;
  @ContentChildren('list') private listEls: QueryList<ElementRef>;
  @ContentChild('span', { static: true }) private spanEl: ElementRef;
  // @ContentChild(ContentPanelComponent, { static: true }) private panelInstance: ContentPanelComponent;
  @ContentChildren(ContentPanelComponent, { descendants: true }) private panelInstances: QueryList<ContentPanelComponent>;
  constructor() { }

  ngOnInit(): void {
  }

  ngAfterViewInit(): void {
    // console.log('test66-', this.listEl);
    // console.log('test67-', this.spanEl);
    // console.log('test68-', this.panelInstance.el.nativeElement);
    // console.log('test69-', this.listEls);
    console.log('test69-', this.panelInstances);
  }

}
